<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <title>用户列表</title>
</head>
<body>
<h2>用户列表</h2>
<table border="1">
    <tr>
        <th>ID</th>
        <th>用户名</th>
        <th>邮箱</th>
        <th>手机号</th>
        <th>创建时间</th>
        <th>角色</th>
        <th>操作</th>
    </tr>
    <c:forEach var="user" items="${users}">
        <tr>
            <td>${user.id}</td>
            <td>${user.username}</td>
            <td>${user.email}</td>
            <td>${user.phone}</td>
            <td>${user.createTime}</td>
            <td>
                <c:choose>
                    <c:when test="${user.role == 0}">普通用户</c:when>
                    <c:when test="${user.role == 1}">专家用户</c:when>
                    <c:when test="${user.role == 2}">管理员</c:when>
                </c:choose>
            </td>
            <td>
                <a href="${pageContext.request.contextPath}/user/delete?id=${user.id}">删除</a>
            </td>
        </tr>
    </c:forEach>
</table>
</body>
</html>